Add changes for new menuinst fix#5
Conversation
|
|
||
| rem Persist distribution_name to menuinst.toml before installing packages. | ||
| rem This ensures the value is captured even if no packages have shortcuts. | ||
| rem Must run before conda install to avoid creating shortcuts twice. |
There was a problem hiding this comment.
Can you explain that to me? I'm not sure I'm following.
What happens if a user selects to not install shortcuts and there are packages with shortcuts in the payload?
There was a problem hiding this comment.
If we didn't explicitly call menuinst --install before conda install:
conda installruns- No packages have Menu json files →
condanever callsmenuinst menuinst.tomlis never created- Because of 3) the value of
MENUINST_DISTRIBUTION_NAMEis never captured
Then as you can probably see, later (assuming above happened), when a user installs a package with shortcuts into this environment:
condacallsmenuinstto create shortcutsMENUINST_DISTRIBUTION_NAMEis no longer set (installer finished long ago)menuinst.tomldoesn't exist (was never created)menuinstfalls back to derivingdistribution_namefrom the prefix name →"base"
The explicit menuinst --install call ensures distribution_name is written to menuinst.toml now, while the env var is still set, regardless of whether any packages have shortcuts. This way the value is available for any future shortcut creation.
There was a problem hiding this comment.
That part I understand, but not Must run before conda install to avoid creating shortcuts twice. Where would we create shortcuts twice?
There was a problem hiding this comment.
Ahh, yeah I see that it's misleading. The comment was based upon a change I made earlier that didn't work which resulted in duplicated calls to menuinst. Removed, see 5a279c5
There was a problem hiding this comment.
So, what happens if there are packages with shortcuts in the environment? Won't this run menuinst twice? What happens if a user selects not to install shortcuts and the environment has packages with shortcuts?
There was a problem hiding this comment.
So since this is called before any packages are installed, all it does is creating menuinst.toml, and this will happen regardless or not if the user chooses to (or not to) install shortcuts via the installer.
There was a problem hiding this comment.
This is how I understand the menuinst workflow: If you don't give menuinst a list of packages, it will install all shortcuts in the prefix. So, if there is a prefix with packages that install shortcuts, this command will install them before installing the conda package. More importantly, it will install shortcuts even if the user selected not to install shortcuts because there is no guard.
There was a problem hiding this comment.
This is the sequence right now:
- Payload tarball is extracted into %INSTDIR%
- Packages are extracted into
%BASE_PATH%\pkgs\<name>(importantl that they're not considered installed yet menuinst --installruns, and right now%BASE_PATH%\Menu\is empty and no.jsonfiles existconda installruns which will populate (if packages with shortcuts are installed) the%BASE_PATH%\Menudirectory
But at step 3 above, the important detail is that there are no .json files in the Menu directory, which results in only menuinst.toml being generated containing the value of distribution_name.
There was a problem hiding this comment.
Ah, great. Can you point that out in the comment? This isn't an immediately obvious detail.
Description
This PR covers conda#1234.
Checklist - did you ...
newsdirectory (using the template) for the next release's release notes?